import org.apache.spark.sql.SQLContext
import org.apache.spark.{SparkConf, SparkContext}
object PairRDD2RDD
{

  def main(args: Array[String]): Unit = 
    {
    val conf = new SparkConf().setMaster("local").setAppName("RDD2DataFrameByReflection")
    val sc = new SparkContext(conf)
    // val sqlContext = new SQLContext(sc)
    var lines=sc.parallelize(List("i love you"))//ParallelCollectionRDD
    val pairs = lines.map(x=>(x,1))//MapPartitionsRDD

    println("-----------------------------------------------------------------------")
    pairs.foreach(println)
    println("type of lines:"+lines.getClass.getSimpleName)
    println("type of pairs:"+pairs.getClass.getSimpleName)

    println("-----------------------------------------------------------------------")

    }
}

